home *** CD-ROM | disk | FTP | other *** search
/ CD World 1997 November / CD World - Kasım 1997.iso / art / online / msie4pp / wsh.cab / setpass.vbs < prev    next >
Text File  |  1996-10-21  |  2KB  |  53 lines

  1. ' Windows Script Host Sample Script
  2. '
  3. ' ------------------------------------------------------------------------
  4. '               Copyright (C) 1996 Microsoft Corporation
  5. '
  6. ' You have a royalty-free right to use, modify, reproduce and distribute
  7. ' the Sample Application Files (and/or any modified version) in any way
  8. ' you find useful, provided that you agree that Microsoft has no warranty,
  9. ' obligations or liability for any Sample Application Files.
  10. ' ------------------------------------------------------------------------
  11. '
  12. ' VBS Script to set password
  13. '
  14. ' Syntax:  setpass.vbs /C=<country>/O=<o>/OU=<ou> accountname password
  15. '
  16. ' Example setpass.vbs /C=US/O=ArcadiaBay/OU=Americas PaulCezanne secret
  17. '
  18. dim con
  19. dim oArgs
  20. dim newuser
  21.  
  22. dim Style
  23. dim Title
  24. dim CRLF
  25.  
  26. CRLF = Chr(13) & Chr(10)
  27.  
  28. set oArgs = WScript.Arguments
  29.  
  30. If oArgs.Count < 2 Then
  31.        Style = vbOKOnly     ' Define buttons.
  32.        Title = "Usage"      ' Define title.
  33.  
  34.        Response = MsgBox("Set password via OLE DS" & CRLF & CRLF & _
  35.        "Usage:" & CRLF & CRLF & _
  36.        "   setpass.vbs /C=<country>/O=<o>/OU=<ou> accountname password " & CRLF & CRLF & _
  37.        "Example:" & CRLF & CRLF & _
  38.        "   setpass.vbs /C=US/O=ArcadiaBay/OU=Americas PaulCezanne secret" & CRLF, _
  39.         Style, Title)
  40.     
  41.        'stop script
  42.        WScript.Quit(1)
  43. End If
  44.  
  45. set u = wscript.GetObject("LDAP:/"+oArgs.item(0)+"/CN="+oArgs.item(1))
  46. u.setpassword(oArgs.item(2))
  47. wscript.echo "Password for "+u.name+" reset."
  48. set u=nothing
  49. '
  50. ' Finis
  51. '
  52.  
  53.